<%@ page language="java" pageEncoding="utf-8"%>
<%@page import="com.farm.web.constant.FarmConstant"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="/view/conf/farmtag.tld" prefix="PF"%>
<div class="col-md-6" style="padding-left: 8px; padding-right: 8px;">
	<div class="panel panel-default">
		<div class="panel-body">
			<div class="media" style="height: 143px; overflow: hidden;">
				<div class="pull-right">
					<img alt="答题室" style="width: 96px; height: 96px;"
						src="text/img/paper.png">
				</div>
				<div class="media-body">
					<div style="margin-left: 4px;" class="pull-left">
						<div class="doc_node_title_box" style="font-size: 16px;">${paper.info.name}</div>
						<div class="side_unit_info">考试时长：${room.room.timelen}分</div>
						<div class="side_unit_info">题量：共${paper.rootChapterNum}道大题,${paper.subjectNum}道小题</div>
						<div class="side_unit_info">总分：${paper.allPoint}</div>
					</div>
				</div>
				<div style="padding-top: 20px;">
					<div class="btn-group btn-group-justified" role="group"
						aria-label="...">
						<c:if test="${paper.card==null}">
							<div class="btn-group" role="group">
								<a data-toggle="modal" data-target="#${paper.info.id}-win"
									type="button" class="btn btn-default">开始考试&nbsp;Go!</a>
							</div>
						</c:if>
						<c:if test="${paper.card!=null}">
							<c:if test="${paper.card.pstate=='1'}">
								<div class="btn-group" role="group">
									<a
										href="webpaper/paperCard.do?paperid=${paper.info.id}&roomId=${room.room.id}"
										data-toggle="modal" type="button" class="btn btn-success">继续答题
										(<PF:FormatTime date="${paper.card.starttime}"
											yyyyMMddHHmmss="HH:mm:ss" />-<PF:FormatTime
											date="${paper.card.endtime}" yyyyMMddHHmmss="HH:mm:ss" /> )
									</a>
								</div>
							</c:if>
							<c:if
								test="${paper.card.pstate=='3'||paper.card.pstate=='4'||paper.card.pstate=='5'}">
								<p class="alert alert-danger"
									style="padding: 6px; text-align: center;">
									答卷已结束&nbsp;(
									<PF:FormatTime date="${paper.card.starttime}"
										yyyyMMddHHmmss="yyyy-MM-dd HH:mm:ss" />
									-
									<PF:FormatTime date="${paper.card.endtime}"
										yyyyMMddHHmmss="HH:mm:ss" />
									)
								</p>
							</c:if>
							<c:if test="${paper.card.pstate=='2'}">
								<p class="alert alert-success"
									style="padding: 6px; text-align: center;">
									答卷已完成&nbsp;(
									<PF:FormatTime date="${paper.card.starttime}"
										yyyyMMddHHmmss="yyyy-MM-dd HH:mm:ss" />
									-
									<PF:FormatTime date="${paper.card.endtime}"
										yyyyMMddHHmmss="HH:mm:ss" />
									)
								</p>
							</c:if>
						</c:if>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- Modal -->
<div class="modal fade" id="${paper.info.id}-win" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
				<h4 class="modal-title" id="myModalLabel">《${paper.info.name}》</h4>
			</div>
			<div class="modal-body">
				<div class="doc_node_title_box" style="font-size: 16px;">开始答题后，需要在${room.room.timelen}分钟内完成答题，确认是否开始?</div>
				<div class="doc_node_title_box"
					style="font-size: 16px; color: #d13133;">答题人：${USEROBJ.name}</div>
				<div class="side_unit_info" style="font-size: 14px;">
					共<b>${paper.rootChapterNum}</b>道大题,<b>${paper.subjectNum}</b>道小题,总分<b>${paper.allPoint}</b>分
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				<a
					href="webpaper/paperCard.do?paperid=${paper.info.id}&roomId=${room.room.id}"
					class="btn btn-primary">立即开始Go!</a>
			</div>
		</div>
	</div>
</div>